<?php
if (!defined('ZSM_ROOT_DIR'))  die('Hacking attempt');
date_default_timezone_set('Asia/Shanghai');
@ini_set('memory_limit','512M');
@ini_set('session.cache_expire', 180);
@ini_set('session.use_trans_sid', 0);
@ini_set('session.use_cookies', 1);
@ini_set('session.auto_start',0);
ob_start();
if (!session_id()) session_start();
require_once  ZSM_ROOT_DIR.DIRECTORY_SEPARATOR.'lib'.DIRECTORY_SEPARATOR.'lang'.DIRECTORY_SEPARATOR.'error.zh.php';
//自动加载类，顺序为1_auto_load-->2_auto_load-->3_auto_load-->4_auto_load
$dir=ZSM_ROOT_DIR.DIRECTORY_SEPARATOR.'lib'.DIRECTORY_SEPARATOR.'1_auto_load';
$handle=opendir($dir); 
while (false !== ($file = readdir($handle)))
{
	if (str_replace('.php','',$file)!=$file) {
		require_once $dir.DIRECTORY_SEPARATOR.$file;
	}
}
$dir=ZSM_ROOT_DIR.DIRECTORY_SEPARATOR.'lib'.DIRECTORY_SEPARATOR.'2_auto_load';
$handle=opendir($dir); 
while (false !== ($file = readdir($handle)))
{
	if (str_replace('.php','',$file)!=$file) {
		require_once $dir.DIRECTORY_SEPARATOR.$file;
	}
}

$dir=ZSM_ROOT_DIR.DIRECTORY_SEPARATOR.'lib'.DIRECTORY_SEPARATOR.'3_auto_load';
$handle=opendir($dir); 
while (false !== ($file = readdir($handle)))
{
	if (str_replace('.php','',$file)!=$file) {
		require_once $dir.DIRECTORY_SEPARATOR.$file;
	}
}
$dir=ZSM_ROOT_DIR.DIRECTORY_SEPARATOR.'lib'.DIRECTORY_SEPARATOR.'4_auto_load';
$handle=opendir($dir); 
while (false !== ($file = readdir($handle)))
{
	if (str_replace('.php','',$file)!=$file) {
		require_once $dir.DIRECTORY_SEPARATOR.$file;
	}
}
closedir($handle); 
unset($dir);
unset($handle);
unset($file);

//加载模板类
require ZSM_ROOT_DIR.DIRECTORY_SEPARATOR.'lib'.DIRECTORY_SEPARATOR.ZSM_LIB_DIR.'Template.class.php';
$tpl=new Template;